# coding:utf-8
# author:frank
# date:2024/12/30
import pygame

pygame.init()

window = pygame.display.set_mode((400,600))
# 加载图片
img = pygame.image.load('files/back.png')
# 获取图片尺寸
print(img.get_size())
# 渲染图片(可以使用blit渲染多个图)
# window.blit(img,(0,0))
# 图片缩放(自定义尺寸)
img2 = pygame.transform.scale(img,(200,300))
window.blit(img2,(0,0))

# 图片缩放&旋转
# rotozoom(图片,旋转角度,缩放比)
img3 = pygame.transform.rotozoom(img,45,0.2)
window.blit(img3,(0,300))
# 刷新屏幕
pygame.display.flip()


while True:
    for event in pygame.event.get():
        if event.type ==pygame.QUIT:
            exit()